package com.tool

import android.content.Context
import android.view.Gravity
import android.widget.Toast

/**
 * Created by mac on 2017/8/4.
 */
class KToast {

    companion object {
        fun shortToast(context: Context?, message: String?) {
            Toast.makeText(context, message, Toast.LENGTH_SHORT).show()
        }

        fun longToast(context: Context?, message: String?) {
            Toast.makeText(context, message, Toast.LENGTH_LONG).show()
        }

        fun centerToast(context: Context?, message: String?) {
            val toast = Toast.makeText(context, message, Toast.LENGTH_SHORT)
            toast.setGravity(Gravity.CENTER, 0, 0)
            toast.show()
        }
    }
}